<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<script type="text/javascript">
</script>
<div class="content-wrap">
    <div class="wrapper" style="bottom: 50px;">
        <ul class="nav nav-tabs">
            <li class="active">
                <a href="#">
                    领药单详情
                </a>
            </li>
            <li class="active">
                <a href="#" onclick="loadDiv('rightCenterDiv','${ctx}/operation/operationCost/operationCostCreateList')">生成领药单</a>
            </li>
        </ul>
        <section class="panel panel-default">
            <div class="panel-body">
                <div class="table-responsive no-border">
                    <table id="itemTable" class="table table-bordered mg-t datatable">
                        <thead>
                        <tr>
                            <th>药品名称</th>
                            <th>厂商</th>
                            <th>单剂数量</th>
                            <th>剂数</th>
                            <th>单价/元</th>
                            <th>发药规格</th>
                            <th>发药单位</th>
                            <th>服药途径</th>
                            <th>服药频次</th>
                            <th>单次计量</th>
                            <th>总价/元</th>
                            <c:if test="${prescriptionItem.flag==0}">
                                <th>操作</th>
                            </c:if>
                        </tr>
                        </thead>
                        <tbody>
                        <c:forEach items="${prescriptionItemList}" var="prescItem">
                            <tr>
                                <td> ${prescItem.drugName}</td>
                                <td> ${prescItem.firmName}</td>
                                <td> ${prescItem.num}</td>
                                <td>${prescItem.repetition}</td>
                                <td>${prescItem.price}</td>
                                <td> ${prescItem.packageSpec}</td>
                                <td> ${fns:getDictLabel(prescItem.packageUnit,'SPEC_UNIT' ,'' )}</td>
                                <td> ${fns:getSysDictLabel(prescItem.channel, 'ADMINISTRATION_DICT', '')}</td>
                                <td> ${fns:findFreqDesc(prescItem.frequency,defaultValue)}</td>
                                <td> ${prescItem.singleDosage}${prescItem.singleUnit}</td>
                                <td>${prescItem.sumPrice}</td>
                                <c:set var="totalCosts" value="${prescItem.sumPrice+totalCosts}"></c:set>
                                <c:if test="${prescriptionItem.flag==0}">
                                    <th></th>
                                </c:if>
                            </tr>
                        </c:forEach>
                        <tr>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td></td>
                            <td>合计：</td>
                            <td><c:out value="${totalCosts}"></c:out></td>
                            <c:if test="${prescriptionItem.flag==0&&totalCosts>0}">
                                <th><button class="btn btn-info" type="button" onclick="cardDrug('${prescriptionItem.applyId}','${prescriptionItem.ordersId}','${totalCosts}','${prescriptionItem.clinicId}')">刷卡发药</button></th>
                            </c:if>
                        </tr>
                    </table>
                </div>
            </div>
        </section>
    </div>
</div>